<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../../include/admincontent.jsp" %>
<div id="Content">
<%--    <div class="btnbar">
        <button type="button" class="list" id="sz_plan">实作安排</button>
        <button type="button" class="import" id="outplan">导出实作安排</button>
        <button type="button" class="list" id="sz_msg">发短信</button>
        <button type="button" class="import" id="sz_in">导入实作结果</button>
        <button type="button" class="list" id="dosz_tjgw" pid="${pid}" fid="${fid}" deptcode="${deptcode}">推荐其他岗位
        </button>
        <button type="button" class="card" id="publishresult" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</button>
        <button type="button" class="list" id="do_next">进入下一步</button>
        <button type="button" class="save" id="resume_output">导出</button>
        <button type="button" class="save" id="resume_input">导入</button>
        &lt;%&ndash;<button type="button" class="back" onclick="javascript:history.go(-1);">返 回</button>&ndash;%&gt;
    </div>--%>
    <div class="toolbars" style="height:30px;white-space:nowrap;width:auto;margin-left: 10px;" totalwidth="314">
        <a id="sz_plan">
            <em class="ico16 sort_text_16"></em>
            <span class="menu_span" title="实作安排">实作安排</span>
        </a>
        <a id="outplan" style="margin-left: 5px">
            <em  class="ico16 outIcon"></em>
            <span  class="menu_span" title="导出实作安排">导出实作安排</span>
        </a>
        <a id="sz_msg" style="margin-left: 5px">
            <em  class="ico16 common_language_16"></em>
            <span  class="menu_span" title="发短信">发短信</span>
        </a>
        <a id="sz_in" style="margin-left: 5px">
            <em  class="ico16 into_warehouse_16"></em>
            <span  class="menu_span" title="导入实作结果">导入实作结果</span>
        </a>
        <a id="dosz_tjgw" style="margin-left: 5px">
            <em  class="ico16 sort_ch_16"></em>
            <span  class="menu_span" title="推荐其他岗位"  pid="${pid}" fid="${fid}" deptcode="${deptcode}">推荐其他岗位</span>
        </a>
        <a id="publishresult" style="margin-left: 5px">
            <em  class="ico16 plan_16"></em>
            <span  class="menu_span" title="公布/屏蔽结果" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</span>
        </a>
        <a id="do_next" style="margin-left: 5px">
            <em  class="ico16 more_blue"></em>
            <span  class="menu_span" title="进入下一步">进入下一步</span>
        </a>
        <a id="resume_output" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_down"></em>
            <span  class="menu_span" title="导出">导出</span>
        </a>
        <a id="resume_input" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_up"></em>
            <span  class="menu_span" title="导入">导入</span>
        </a>
    </div>

    <!-- 面试计划 -->
    <div id="planpanel" class="condition_cont">
        <form id="thisform1" method="post" action="/Do/SZOperation/PlanAction?fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="55">实作时间:</td>
                    <td width="300">
                        <div><input type="text" name="starttime" class="select" datatype="*" nullmsg="实作时间不能为空"
                                    onFocus="blur()" onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"/></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>实作地址:</td>
                    <td>
                        <div><select name="address" datatype="*" nullmsg="实作地址不能为空">${dz}</select></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button type="submit" class="op">保存实作安排</button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>
            <div id="msusers"></div>
        </form>
    </div>

    <!-- 实作通知 -->
    <div id="msgpanel" class="condition_cont">
        <form id="thisform2" method="post"
              action="/Do/SZOperation/MsgAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">短信模版：</td>
                    <td width="500">
                        <div><select id="dxmb" datatype="*" nullmsg="短信模版不能为空！">${dxmb}</select></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>短信内容：</td>
                    <td>
                        <div><textarea name="dxnr" datatype="*" nullmsg="短信内容不能为空！"></textarea></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button type="submit" class="save">提 交</button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>
            <div id="msgusers"></div>
        </form>
    </div>

    <!-- 筛选条件 -->
    <%--<div id="searchbox">
        <form id="sform">
            <input type="hidden" name="proid" value="${pid}"/>
            <input type="hidden" name="path" value="/${fid}/"/>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td>姓名:</td>
                    <td colspan="2">
                        <div><input type="text" name="name"/></div>
                    </td>
                    <td>身份证号:</td>
                    <td colspan="3">
                        <div><input type="text" name="cardno"/></div>
                    </td>

                    <td>短信通知:</td>
                    <td colspan="3">
                        <div>
                            <select name="notice">
                                <option value="-1">全部</option>
                                <option value="0">已发通知</option>
                                <option value="1">未发通知</option>
                            </select>
                        </div>
                    </td>
                    <td>实作结果:</td>
                    <td colspan="3">
                        <div>
                            <select name="szresult">
                                <option value="">全部</option>
                                <option value="结果未生成">结果未生成</option>
                                <option value="未通过">未通过</option>
                                <option value="通过">通过</option>
                            </select>
                        </div>
                    </td>
                    <td></td>
                </tr>
                <tr class="moretj">
                    <td>招聘职位:</td>
                    <td colspan="2">
                        <div><select name="jname">
                            <option value="">不限</option>
                            ${jobs}</select></div>
                    </td>
                    <td>毕业院校:</td>
                    <td colspan="3">
                        <div><input type="text" name="university"/></div>
                    </td>
                    <td>所学专业:</td>
                    <td colspan="3">
                        <div><input type="text" name="majorname"/></div>
                    </td>
                    <td>最高学历:</td>
                    <td colspan="3">
                        <div><select name="education">
                            <option value="">不限</option>
                            ${education}</select></div>
                    </td>
                    <td></td>
                </tr>
                <tr class="moretj">
                    <td>民族:</td>
                    <td colspan="2">
                        <div><select name="mzcode">
                            <option value="">不限</option>
                            ${minzu}</select></div>
                    </td>
                    <td>政治面貌:</td>
                    <td colspan="3">
                        <div><select name="zzmmcode">
                            <option value="">不限</option>
                            ${zzmm}</select></div>
                    </td>
                    <td>婚否:</td>
                    <td colspan="3">
                        <div><select name="mcode">
                            <option value="">不限</option>
                            ${hunfou}</select></div>
                    </td>
                    <td>职业资格证:</td>
                    <td>
                        <div><select name="qllevelpid" id="s_jndjp">
                            <option value="">不限</option>
                            ${jndj}</select></div>
                    </td>
                    <td>
                        <div><select name="qllevelcode" id="s_jndj">
                            <option value="">不限</option>
                        </select></div>
                    </td>
                    <td>
                        <div><select name="qllevelscode" id="s_jndjs">
                            <option value="">不限</option>
                        </select></div>
                    </td>
                    <td></td>
                </tr>
                <tr class="moretj">
                    <td width="80">专业技术职务:</td>
                    <td width="80">
                        <div><select name="posttype" id="s_postt">
                            <option value="">不限</option>
                            ${posttype}</select></div>
                    </td>
                    <td width="80">
                        <div><select name="postlevel" id="s_postl">
                            <option value="">不限</option>
                        </select></div>
                    </td>
                    <td width="70" style="text-align:right;">年龄:</td>
                    <td width="60">
                        <div><input type="text" name="agefrom"/></div>
                    </td>
                    <td width="16" style="text-align:center;">至</td>
                    <td width="60">
                        <div><input type="text" name="ageto"/></div>
                    </td>
                    <td width="60" style="text-align:right;">工作年限:</td>
                    <td width="50">
                        <div><input type="text" name="workyearfrom"/></div>
                    </td>
                    <td width="36" style="text-align:center;">至</td>
                    <td width="50">
                        <div><input type="text" name="workyearto"/></div>
                    </td>
                    <td width="70" style="text-align:right;">身高:</td>
                    <td width="55">
                        <div><input type="text" name="heightfrom"/></div>
                    </td>
                    <td width="105" style="text-align:center;">至</td>
                    <td width="80">
                        <div><input type="text" name="heightto"/></div>
                    </td>
                    <td></td>
                </tr>
                <tr class="moretj">
                    <td>简历编号:</td>
                    <td colspan="2">
                        <div><input type="text" name="code"/></div>
                    </td>

                    <td>户口所在地:</td>
                    <td colspan="3">
                        <div><input type="text" name="hukouaddress"/></div>
                    </td>
                    <td>现居住地:</td>
                    <td colspan="3">
                        <div><input type="text" name="nowaddress"/></div>
                    </td>
                    <td>是否放弃:</td>
                    <td colspan="3">
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td colspan="15">
                        <button id="searchbtn" type="button" class="search"></button>
                    </td>
                    <td>
                        <button id="showhidebtn" type="button" class="moretjbtn0" onclick="moreparam()"
                                title="高级查询"></button>
                    </td>
                </tr>
                </thead>
            </table>
        </form>
    </div>--%>

    <div id="searchbox">
        <form id="sform">
            <input type="hidden" name="proid" value="${pid}"/>
            <input type="hidden" name="path" value="${fid}"/>
            <input type="hidden" name="rcount" id="checkrount" value=""/>
            <input type="hidden" name="checkIds" id="checkIds" value=""/>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">应聘岗位:</td>
                    <td >
                        <div>
                            <%-- <input type="text" name="jname"/>--%>

                            <select name="jname">
                                <option value="">请选择</option>
                                <c:forEach var="projectinfojobs" items="${jobs}" varStatus="item" >
                                    <c:choose>
                                        <c:when test="${projectinfojobs!=null}">
                                            <option value="${projectinfojobs.jobname}">${projectinfojobs.jobname}</option>
                                        </c:when>

                                    </c:choose>
                                </c:forEach>
                            </select>
                        </div>
                    </td>
                    <td width="60">姓名:</td>
                    <td>
                        <div><input type="text" name="name"/></div>
                    </td>
                    <td width="60">身份证号:</td>
                    <td>
                        <div><input type="text" name="cardno"/></div>
                    </td>

                    <td width="60">所学专业:</td>
                    <td >
                        <div>
                            <input type="text" name="majorname"/>
                        </div>
                    </td>
                    <td width="60">毕业院校:</td>
                    <td >
                        <div>
                            <input type="text" name="university"/>
                        </div>
                    </td>


                </tr>
                <tr>
                    <td >毕业时间:</td>
                    <td>
                        <div><input type="text" name="graduationtime"/></div>
                    </td>
                    <td>联系电话:</td>
                    <td>
                        <div>
                            <input type="text" name="tel"/>
                        </div>
                    </td>
                    <td>最高学历:</td>
                    <td >
                        <div><select name="education">
                            <option value="-1">不限</option>
                            ${education}</select></div>
                    </td>
                    <td>短信通知:</td>
                    <td >
                        <div>
                            <select name="notice">
                                <option value="-1">全部</option>
                                <option value="0">已发通知</option>
                                <option value="1">未发通知</option>
                            </select>
                        </div>
                    </td>
                    <td>实作结果:</td>
                    <td >
                        <div>
                            <select name="szresult">
                                <option value="">全部</option>
                                <option value="结果未生成">结果未生成</option>
                                <option value="未通过">未通过</option>
                                <option value="通过">通过</option>
                            </select>
                        </div>
                    </td>


                </tr>
                <tr class="moretj">
                    <td width="60">民族:</td>
                    <td width="150">
                        <div><select name="mzcode">
                            <option value="">不限</option>
                            ${minzu}</select></div>
                    </td>
                    <td width="60">政治面貌:</td>
                    <td width="150">
                        <div><select name="zzmmcode">
                            <option value="">不限</option>
                            ${zzmm}</select></div>
                    </td>
                    <td width="60" style="text-align:right;">年龄:</td>
                    <td width="160">
                        <div><input type="text" name="agefrom" style="max-width: 40%"/>至<input type="text" name="ageto" style="max-width: 40%"/></div>
                    </td>
                    <%-- <td width="16" style="text-align:center;">至</td>
                     <td width="60">
                         <div><input type="text" name="ageto"/></div>
                     </td>--%>
                    <td width="60" style="text-align:right;">身高:</td>
                    <td width="160">
                        <div><input type="text" name="heightfrom" style="max-width: 40%"/>至<input type="text" name="heightto" style="max-width: 40%"/></div>
                    </td>
                    <%--  <td width="36" style="text-align:center;">至</td>
                      <td width="50">
                          <div></div>
                      </td>--%>
                    <td width="60">性别:</td>
                    <td>
                        <div>
                            <select name="sex">
                                <option value="">不限</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </td>
                </tr>
                <tr class="moretj">


                    <td>户口所在地:</td>
                    <td>
                        <div><input type="text" name="hukouaddress"/></div>
                    </td>
                    <td>现居住地:</td>
                    <td>
                        <div><input type="text" name="nowaddress"/></div>
                    </td>
                    <td>是否放弃:</td>
                    <td>
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                    <td  style="text-align:right;">工作年限:</td>
                    <td >
                        <div><input type="text" name="workyearfrom" style="max-width: 40%"/>至<input type="text" name="workyearto" style="max-width: 40%"/></div>
                    </td>

                    <td>职业资格证:</td>
                    <td>
                        <div><select name="qllevelpid" id="s_jndjp">
                            <option value="">不限</option>
                            ${jndj}</select></div>
                    </td>
                </tr>
                <tr class="moretj">
                    <td>简历状态:</td>
                    <td >
                        <div> <select name="state">
                            <option value="">不限</option>
                            <option value="未处理">未处理</option>
                            <option value="已通过">已通过</option>
                            <option value="未通过">未通过</option>
                        </select></div>
                    </td>
                    <td>意向地点:</td>
                    <td >
                        <div>
                            <input type="text" name="presentsalaryamount"/>
                        </div>
                    </td>
                    <td colspan="6"></td>

                </tr>
                <tr>
                    <td colspan="9">
                      <%--  <div style="padding-top: 8px;"> <button id="searchbtn" type="button" class="search"></button>
                            <button id="clearbtn" type="reset" class="del" title="清除" style="flex: 1;margin-left: 5px;"></button>
                        </div>--%>
                    </td>
                    <td>
                        <%--<button id="showhidebtn" type="button" class="moretjbtn0" onclick="moreparam()"
                                title="高级查询"></button>--%>
                    </td>
                </tr>
                </thead>
            </table>
        </form>
    </div>

    <div id="page_top" class="page"></div>
    <table class="treeTable" id="tablelist">
        <thead>
        <tr>
            <td width="20"><input type="checkbox" class="allcheckbox" title="选择全部/取消全选"/></td>
            <td width="30">序号</td>
           <%-- <td width="60">简历编号</td>--%>
            <td width="60">姓名</td>
            <td width="110">身份证号</td>
            <td width="70">学历</td>
            <td width="50">工作经验</td>
            <td width="80">招聘职位</td>
            <td width="70">联系方式</td>
            <td width="95">实作时间</td>
            <td width="110">实作地点</td>
            <td width="50">短信通知</td>
            <td width="50">实作得分</td>
            <td width="60">实作结果</td>
            <td width="50">备注</td>
            <td width="50">个人情况</td>
            <td width="50">公布结果</td>
            <td width="45"></td>
        </tr>
        </thead>
        <tbody id="result"></tbody>
    </table>
    <div id="page_bottom" class="page"></div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        getList();
/*        $('#searchbtn').click(function () {
            $('#msusers').html('');
            $('#msgusers').html('');
            getList();
        });*/
        $('#searchbtn').on('click',function () {
            $('#msusers').html('');
            $('#msgusers').html('');
            getList();
        });

        $('#clearbtn').on('click',function () {
            document.getElementById("sform").reset();
        });
        getMsg();

        //全选当页
        $(document).delegate('.allcheckbox', 'click', function () {
            $(this).parent().parent().parent().next().find('input[type=checkbox]').each(function () {
                var ck = $(this);
                if (ck.is(":checked")) {
                    $('#msusers').append('<input type="hidden" name="uid" value="' + $(this).val() + '"/>');
                    $('#msgusers').append('<input type="hidden" name="uid" value="' + $(this).val() + '"/>');
                } else {
                    $('#msusers input').each(function () {
                        if ($(this).val() == ck.val())
                            $(this).remove();
                    });
                    $('#msgusers input').each(function () {
                        if ($(this).val() == ck.val())
                            $(this).remove();
                    });
                }
            });
        });
        //选择一条
        $(document).delegate('#tablelist tbody tr', 'click', function () {
            var ck = $(this).find('input[type=checkbox]');
            if (ck.is(":checked")) {
                $('#msusers').append('<input type="hidden" name="uid" value="' + ck.val() + '"/>');
                $('#msgusers').append('<input type="hidden" name="uid" value="' + ck.val() + '"/>');
            } else {
                $('#msusers input').each(function () {
                    if ($(this).val() == ck.val())
                        $(this).remove();
                });
                $('#msgusers input').each(function () {
                    if ($(this).val() == ck.val())
                        $(this).remove();
                });
            }
        });

        //实作安排
        $('#sz_plan').click(function () {
            $('#planpanel').slideToggle(300);
            $(this).toggleClass('cur').blur().siblings().removeClass('cur');
            if (!$('#msgpanel').is(":hidden")) {
                $('#msgpanel').slideToggle(300);
            }
        });

        //导出实作安排
        $('#outplan').click(function () {
            var uid = '';
            $('#msusers input').each(function () {
                uid += '&uid=' + $(this).val();
            });
            location = '/Do/SZOperation/exportplan?fid=${fid}' + uid;
        });

        //导入成绩
        $('#sz_in').click(function () {
            openLayer('导入实作成绩', '/Do/SZOperation/import?pid=${pid}&fid=${fid}&deptcode=${deptcode}', '80%', '80%');
        });

        //实作通知
        $('#sz_msg').click(function () {
            $('#msgpanel').slideToggle(300);
            $(this).toggleClass('cur').blur().siblings().removeClass('cur');
            if (!$('#planpanel').is(":hidden")) {
                $('#planpanel').slideToggle(300);
            }
        });
        $('#dxmb').change(function () {
            getMsg();
        });

        $('#do_next').click(function () {
            parent.layer.confirm('只有实作已通过的人员才能进入下一步。<br>确定要执行吗？', {
                btn: ['是', '否']
            }, function () {
                /*layer.closeAll();
                SubmitAll('/Do/SZOperation/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}', 'msusers');
                changeToNextTab('${fid}');*/
                toNextFlow('/Do/SZOperation/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}','${fid}');
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });
        });

    });

    function viewResult(uid) {
        openpLayer('查看实作结果', '/Do/SZOperation/viewResult?id=' + uid, '90%', '90%');
    }



    function getList() {
        $('.page').myPagination({
            cssStyle: "pagination",
            saveChecked:true,
            showTitle:true,
            rowNumber:true,
            contextMenu:true,
            contextMenuParam:{
                menu: [{
                    text: "情况说明",
                    callback: function(ele) {
                        console.log($(this))
                        var tcid=$(ele).find('input[type=checkbox]:eq(0)').attr('id');
                        var rmarkid=$(ele).find('input[type=hidden]:eq(0)').val();
                        var cardno=ele[0].cells[3].innerText;
                        var rname=ele[0].cells[2].innerText;
                        parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 个人情况说明，并确认', formType: 2}, function(text, index){
                            parent.layer.close(index);
                            var cid=tcid.replace('cb_','');
                            $.post("/SaveUserRemark"
                                ,{id:rmarkid,pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",rid:cid,content:text,rname:rname,cardno:cardno}
                                ,function (result) {
                                    if (result.state) {
                                        $.Showmsg(result.message);
                                        getList();
                                    }
                                    else {
                                        $.Showmsg(result.message);
                                    }
                                }
                                ,"json");
                        });
                    }
                },
                    {
                        text: "查看个人简历",
                        callback: function(ele) {
                            var url=$(ele).find('a').attr('href');
                            if(!!url){
                                window.open(url);
                            }
                        }
                    },
                    {
                        text: "刷新列表",
                        callback: function() {
                            getList()
                        }
                    }
                ]
            },
            ajax: {
                on: true,
                url: '/Do/SZOperation/getusers?flowid=${fid}',
                param: $('#sform').serialize(),
                dataType: 'html',
                callback: function (data) {
                    $('#result').html(data);
                    parent.changeFrameHeight();
                    $('#result a').click(function () {
                        event.stopPropagation();
                    });
                    $('#msgusers input').each(function () {
                        var tval = $(this).val();
                        $('#result tr').each(function () {
                            var cb = $(this).find('input[type=checkbox]');
                            if (cb.length > 0 && tval == cb.val()) {
                                cb.attr('checked', 'true');
                                if (!$(this).hasClass('checked')) {
                                    $(this).addClass('checked');
                                }
                            }
                        });
                    });
                }
            }
        });
    }

    function getMsg() {
        getAjax('/Do/BS/getMsg?code=' + $('#dxmb').val(), null, function (data) {
            $('textarea[name=dxnr]').val(data);
        });
    }

    $(function () {
        $('#resume_output').click(function () {
            var ids= $('#checkIds').val('').val();
            var selectData = layui.table.checkStatus('listTables').data;
            if(selectData!=undefined&&selectData.length>0){
                for(var i=0;i<selectData.length;i++){
                    ids += selectData[i].id_cb.replace('cb_', '') + ',';
                }
                ids=ids.substr(0,ids.length-1);
                $('#checkIds').val(ids);
            }
            openpLayer('请选择要导出的字段', '/ExcelDown/DownDoResume?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '70%');
        });

        $('#resume_input').click(function () {
            openpLayer('Excel数据导入', '/ExcelImport/ImportExcelPage?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '500px');
        });
    });
</script>
</body>
</html>